<?php

namespace app\index\validate;

use think\Validate;

class MessagesComment extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名'	=>	['规则1','规则2'...]
     *
     * @var array
     */
	protected $rule = [
        'request_check|是否请求重审' => 'require|boolean',
        'content|消息内容' => 'require|length:1,500',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名'	=>	'错误信息'
     *
     * @var array
     */
    protected $message = [
        'style.in' => '题目形式只能在选择、填空之中',
    ];

    /**
     * 场景，键名为对应的函数名
     */
    protected $scene = [
        'createQuestionCommentMessage'  =>  [
            'request_check',
            'content',
        ],
        'editQuestionCommentMessage'  =>  [
            'content',
        ]
    ];
}
